/*
 * globalsensor_tm_store.h
 *
 *  Created on: Feb 19, 2013
 *      Author: user
 */

#ifndef GLOBALSENSOR_TM_STORE_H_
#define GLOBALSENSOR_TM_STORE_H_

#include <public/PackMemManager.h>
#include <public/ssi_link_layer.h>


class CGlobalSensorTMStore{

	//free pack list
	CPackListHandler m_free_pack_list;

	//tm pack list

	CPackListHandler m_tm_pack_list;

	CPackHandler m_currentPack;

	uint8_t m_currentPackIndex;
	uint8_t m_currentPackFrameNumber;

public:

	void add_free_pack_list(CPackListHandler &);
	void get_free_pack_list(CPackListHandler &);
	void get_tm_pack_list(CPackListHandler &);
	void restore_tm_pack_list(CPackListHandler &);
	bool_t store_ssi_tm_frame(byte_t *pFrame);
	//void store_ssi_tm_frame();
	//void ImageToFrames();

protected:

	bool frameCanBeStoredInPack(byte_t *pFrame);
	void PaddingWithZeroesCurrentPack();
	//void int_to_string(int num,char * pConvert);
	//void build_frame_bidireccional(char buff,int bytesReaded,char frame);

};

#endif /* GLOBALSENSOR_TM_STORE_H_ */
